package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.mall.mapper.MallAddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.mall.entity.MallAddress;
import com.ruoyi.mall.service.IMallAddressService;
import com.ruoyi.common.core.text.Convert;

/**
 * 会员地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-16
 */
@Service
public class MallAddressServiceImpl implements IMallAddressService 
{
    @Autowired
    private MallAddressMapper mallAddressMapper;

    /**
     * 查询会员地址
     * 
     * @param addressId 会员地址ID
     * @return 会员地址
     */
    @Override
    public MallAddress selectMallAddressById(Long addressId)
    {
        return mallAddressMapper.selectMallAddressById(addressId);
    }

    /**
     * 查询会员地址列表
     * 
     * @param mallAddress 会员地址
     * @return 会员地址
     */
    @Override
    public List<MallAddress> selectMallAddressList(MallAddress mallAddress)
    {
        return mallAddressMapper.selectMallAddressList(mallAddress);
    }

    /**
     * 会员手机号查地址
     * @param phone 会员手机号
     * @return
     */
    @Override
    public List<MallAddress> selectAddressByPhone(String phone) {
        return this.mallAddressMapper.selectAddressByPhone(phone);
    }

    /**
     * 新增会员地址
     * 
     * @param mallAddress 会员地址
     * @return 结果
     */
    @Override
    public int insertMallAddress(MallAddress mallAddress)
    {
        return mallAddressMapper.insertMallAddress(mallAddress);
    }

    /**
     * 修改会员地址
     * 
     * @param mallAddress 会员地址
     * @return 结果
     */
    @Override
    public int updateMallAddress(MallAddress mallAddress)
    {
        return mallAddressMapper.updateMallAddress(mallAddress);
    }

    /**
     * 删除会员地址对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMallAddressByIds(String ids)
    {
        return mallAddressMapper.deleteMallAddressByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除会员地址信息
     * 
     * @param addressId 会员地址ID
     * @return 结果
     */
    @Override
    public int deleteMallAddressById(Long addressId)
    {
        return mallAddressMapper.deleteMallAddressById(addressId);
    }
}
